package work2022_07_11;

public class Test7 {

	public static void main(String[] args) {
		//T恤单价   网球鞋单价   网球拍单价
		double prise1 = 245, prise2 = 570, prise3 = 320;
		// T恤数量 网球鞋数量 网球拍数量
		int num1 = 2, num2 = 1, num3 = 1;
		int discount = 8;// 折扣
		double pay = 1500;// 实际缴费
		// 总金额 
		double total;
		//金额=单价*数量
		total = (prise1 * num1 + prise2 * num2 + prise3 * num3) * discount / 10;
		//找钱
		double changemoney;
		//找钱=实际缴费-总金额
		changemoney = pay - total;
		//积分
		int score; 
		//每100元3分
		score =  (int) (total / 100 * 3);// 定义积分  100元3分

		System.out.println("********消费单********");

		System.out.println("购买物品\t\t单价\t个数\t金额");

		System.out.println("T恤\t\t￥" + prise1 + "\t" + num1 + "\t￥" + prise1 * num1);

		System.out.println("网球鞋\t\t￥" + prise2 + "\t" + num2 + "\t￥" + prise2 * num2);

		System.out.println("网球拍\t\t￥" + prise3 + "\t" + num3 + "\t￥" + prise3 * num3);

		System.out.println("----------------------------------------");

		System.out.println("折扣：\t" + discount + "折");

		System.out.println("消费总金额:￥" + total);

		System.out.println("实际缴费\t￥" + pay);

		System.out.println("找钱\t￥" + changemoney);

		System.out.println("本次购物所获得的积分是：" + score);

	}

}
